<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:b="http://bootsfaces.net/ui"
      xmlns:appbase="http://xmlns.jcp.org/jsf/composite/appbase"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/resources/template/squelette/squelette.xhtml">

        <ui:define name="titre">
            <h:outputText value="Détails du pays #{administrationPaysDetailsController.pays.libelle}" />
        </ui:define>

        <ui:define name="content">
            <b:panel>
                <f:facet name="heading">
                    <h:form>
                        <div class="text-center">
                            <b:buttonGroup>
                                <b:button value="Modifier" look="primary" outcome="pretty:nav_administration_pays_modif">
                                    <f:param name="id" value="#{administrationPaysDetailsController.pays.id}"/>
                                </b:button>
                                <b:commandButton value="Supprimer" look="danger" oncomplete="$('#modal_suppression_pays').modal('show')" ajax="true" update="modal_suppression_pays"/>
                            </b:buttonGroup>
                        </div>
                    </h:form>
                </f:facet>

                <h:panelGroup styleClass="form-horizontal">
                    <appbase:ligne-details label="Code" value="#{administrationPaysDetailsController.pays.code}"/>
                    <appbase:ligne-details label="Libellé" value="#{administrationPaysDetailsController.pays.libelle}"/>
                    <appbase:ligne-details label="Code alpha2" value="#{administrationPaysDetailsController.pays.alpha2}"/>
                    <appbase:ligne-details label="Code alpha3" value="#{administrationPaysDetailsController.pays.alpha3}"/>
                </h:panelGroup>
            </b:panel>
        </ui:define>

        <ui:define name="modal">
            <b:modal id="modal_suppression_pays" title="Suppression du pays #{administrationPaysDetailsController.pays.libelle}">
                <p><h:outputText value="Êtes vous sûr de vouloir supprimer le pays #{administrationPaysDetailsController.pays.libelle} ?"/></p>
                <f:facet name="footer">
                    <h:form>
                        <b:commandButton value="Non" oncomplete="$('#modal_suppression_pays').modal('hide')" ajax="true"/>
                        <p:commandButton value="Oui"  action="#{administrationPaysDetailsController.supprimer()}"  />
                    </h:form>
                </f:facet>
            </b:modal>
        </ui:define>

    </ui:composition>
</html>